package com.leave.mos.controller.find;

import com.leave.mos.entity.Order;
import com.leave.mos.entity.QueryParam;
import com.leave.mos.service.find.QueryParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
import java.util.List;

/**
 * @ClassName MongodbSaveController
 * @Description TODO
 * @Author lh
 * @Date 2021/7/7 17:42
 * @Version 1.0
 **/

@RestController
@RequestMapping("query")
public class QueryParamController {

    @Autowired
    private QueryParamService queryParamService;

    @RequestMapping("/findQuery1")
    List<Order> findQuery1(QueryParam queryParam){
        return queryParamService.findQuery1(queryParam);
    }

    @RequestMapping("findQuery2")
    List<Order> findQuery2(QueryParam queryParam){
       return queryParamService.findQuery2(queryParam);
    }

    //
    @GetMapping("findQuery3")
    List<Order> findQuery3(QueryParam queryParam){
        return queryParamService.findQuery3(queryParam);
    }
//
    @GetMapping("findQuery4")
    List<Order> findQuery4(QueryParam queryParam) throws ParseException {
        return queryParamService.findQuery4(queryParam);
    }
//
//    @GetMapping("findById")
//    Order findById(String id){
//        return mongodbSelectService.findById(id);
//    }
//
//    @GetMapping("findAllAndRemove")
//    List<Order> findAllAndRemove(String id){
//        return mongodbSelectService.findAllAndRemove();
//    }

}
